<!DOCTYPE html>
<html lang="ch">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<link rel="stylesheet" href="css/register.css">
	<link rel="stylesheet" href="css/bootstrap.min.css">

	<script src="js/jquery-3.4.1.js"></script>
	<!-- <script src="/js/register.js"></script> -->
	<script>
		var rUser, rPwd, rMail;
		//when the webpage is ready
		$(function() {
			// $("#sign-in-btn").click(function () {
			// 	alert("hahah")
			// });	
			$(".input-block").on("change", function () {
				rUser = $("#username").val();
				rMail = $("#email").val();
				rPwd = $("#pwd").val();
				if (rUser && rPwd && rMail) {
					$('#register-btn').attr('disabled', false);
				}
				else {
					$('#register-btn').attr('disabled', true);
				}
			})

			$("#sign-in-btn").on("click", function() {
				window.location.href = "login.html";
			})
		});


		function check() {
			var a = usernameCheck();
			var b = pwdCheck();
			var c = emailCheck();

			if(usernameCheck() && pwdCheck() && emailCheck()){

				return true;
			}else {
				return false;
			}
		}


		function saving() {
			if (check()) {
				var rInfo = {
					"username": rUser,
					"pwd":rPwd,
					"mail": rMail,
					"registerTime": time,
					"loginTime": time,
					"logTimes": 0
				};
			} else {
				return false;
			}
		}


		

	</script>
	<title>加入BESC·BESC</title>

</head>
<body>
	<div id = "map">
		<div class="center-container position-relative">
			<div class="sign-up-caption">注册</div>
			<div class="setup-form-container">
				<label for="user_login" name="user[login]">用户名 </label>
				<input type="text" class="input-block" 
				 placeholder="你的姓名或常用昵称" id="username">
				
				<label for="user_email" name="user[email]">邮箱地址</label>
				<input type="text" class="input-block" 
				 placeholder="常用邮箱" id="email">
	
				<label for="user_password" name="user[password]">密码 </label>
				<input type="password" class="input-block" 
				 placeholder="不少于6位的密码" id="pwd">
				
				<input type="button" value="注册" class="btn" id = "register-btn" disabled>
	
				<input type="button" value="已有账号登陆" class="btn" id="sign-in-btn">
				<p class="text-center">继续即表示你同意《服务条款》和《隐私政策》</p>
			</div>
			</div>
	</div>

</body>

</html>